package com.edgclub.edg.activity;

import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.edgclub.edg.R;
import com.edgclub.edg.utils.GlideUtil.GlideUtils;

import me.nereo.multi_image_selector.bean.Image;

/**
 * 图集
 * 
 * @author eric
 * 
 */
public class ImageSendActivity extends GzBaseTooolBarActivity implements
		OnClickListener {

	private com.edgclub.edg.uc.TouchImageView mTouch_image;
	private RelativeLayout mBtom_lay;
	private ImageView mImage_choice;
	private TextView mImage_choice_text;
	private TextView mImage_choice_text_ytsize;
	private TextView mImage_ok;
	private Image image;
	private GlideUtils glideUtils;

	@Override
	public int getContentView() {
		return R.layout.activity_send_image;
	}

	@Override
	public void setTitleBarView() {
		setCustomActionBar();
		title.setText("选择图片");
	}

	@Override
	public void initView() {
		glideUtils=new GlideUtils();
		image= (Image) getIntent().getSerializableExtra("image");
		mTouch_image = (com.edgclub.edg.uc.TouchImageView) findViewById(R.id.touch_image);
		mBtom_lay = (RelativeLayout) findViewById(R.id.btom_lay);
		mImage_ok = (TextView) findViewById(R.id.image_ok);
		if(null!=image){
			glideUtils.Glidde_loadImagefitCenter(this,image.path,mTouch_image);
		}
		mImage_ok.setOnClickListener(this);
	}

	@Override
	public void initData() {

	}


	@Override
	public void onClick(View view) {
		switch (view.getId()){
			case R.id.image_ok:
				if(null!=image) {
					Intent intent = new Intent(this, MultiImageSelectorActivity.class);
					intent.putExtra("userPath", image.path);
					setResult(RESULT_OK, intent);
					finish();
				}
				break;
		}
	}



}
